using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
public class CookieUtil
{
	public enum GEnum0
	{
		const_0,
		const_1,
		const_10 = 8,
		const_11,
		const_12,
		const_13,
		const_14 = 11,
		const_2 = 1,
		const_3,
		const_4,
		const_5 = 3,
		const_6,
		const_7,
		const_8,
		const_9
	}
	[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
	public static extern bool InternetGetCookie(string string_0, string string_1, StringBuilder stringBuilder_0, ref int int_0);
	[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
	private static extern bool InternetGetCookieEx(string string_0, string string_1, StringBuilder stringBuilder_0, ref int int_0, int int_1, object object_0);
	[DllImport("shell32.dll")]
	public static extern IntPtr ShellExecute(IntPtr intptr_0, string string_0, string string_1, string string_2, string string_3, CookieUtil.GEnum0 genum0_0);
	public static string smethod_0(string string_0)
	{
		int num = 256;
		StringBuilder stringBuilder = new StringBuilder(256);
		if (!CookieUtil.InternetGetCookie(string_0, null, stringBuilder, ref num))
		{
			if (num < 0)
			{
				return null;
			}
			stringBuilder = new StringBuilder(num);
			if (!CookieUtil.InternetGetCookie(string_0, null, stringBuilder, ref num))
			{
				return null;
			}
		}
		return stringBuilder.ToString();
	}
	public static string get_cookie(string url)
	{
		int num = 256;
		StringBuilder stringBuilder = new StringBuilder(256);
		if (!CookieUtil.InternetGetCookieEx(url, null, stringBuilder, ref num, 8192, null))
		{
			if (num < 0)
			{
				return null;
			}
			stringBuilder = new StringBuilder(num);
			if (!CookieUtil.InternetGetCookieEx(url, null, stringBuilder, ref num, 8192, null))
			{
				return null;
			}
		}
		return stringBuilder.ToString();
	}
	public static void smethod_2()
	{
		try
		{
			CookieUtil.ShellExecute(IntPtr.Zero, "open", "rundll32.exe", " InetCpl.cpl,ClearMyTracksByProcess 255", "", CookieUtil.GEnum0.const_0);
			string[] files = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache), "*", SearchOption.AllDirectories);
			for (int i = 0; i < files.Length; i++)
			{
				string path = files[i];
				try
				{
					File.Delete(path);
				}
				catch
				{
				}
			}
		}
		catch
		{
		}
	}
}
